home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / Screen < prev    next >
Text File  |  1996-05-21  |  3KB  |  95 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Screen.h
  12.     Author:  Copyright © 1992 Jasn Williams
  13.     Version: 1.00 (23 Mar 1992)
  14.     Purpose: Screen functions (read size, eig factors, etc.)
  15. */
  16.  
  17. #ifndef __Desk_Screen_h
  18. #define __Desk_Screen_h
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24.  
  25. #ifndef __Desk_Wimp_h
  26.     #include "Desk.Wimp.h"
  27. #endif
  28.  
  29. /* EXTRA NOTES:
  30.  * See Handler.c and '!TestApp.c' for examples of Desk_mode_change handlers to
  31.  * automatically keep all these mode variables up-to-date, etc.
  32.  */
  33.  
  34. /* These variables can be accessed globally for maximum efficiency.
  35.  * Note that they are not valid unless Desk_screen_mode == the current screen mode
  36.  * This can be guaranteed if you call Desk_Screen_CacheModeInfo() every time
  37.  * you get a mode change message, or before you attempt to use these variables
  38.  *
  39.  * Usage should be:
  40.  *   Desk_Screen_CacheModeInfo();
  41.  *   ...
  42.  *   screenwidth = Desk_screen_size.x;   (or whatever)
  43.  *   ...
  44.  */
  45.  
  46.  
  47.  
  48.  
  49. #ifdef Desk__using_SDLS
  50.   extern int        *Desk_Screen__Ref_mode( void);
  51.   extern Desk_wimp_point *Desk_Screen__Ref_size( void);
  52.   extern Desk_wimp_point *Desk_Screen__Ref_eig( void);
  53.   extern Desk_wimp_point *Desk_Screen__Ref_delta( void);
  54.   extern int        *Desk_Screen__Ref_bpp( void);
  55. #endif
  56.  
  57. #if defined( Desk__using_SDLS) && !defined( Desk__making_Misc)
  58.   #define Desk_screen_mode  (*Desk_Screen__Ref_mode())
  59.   #define Desk_screen_size  (*Desk_Screen__Ref_size())
  60.   #define Desk_screen_eig   (*Desk_Screen__Ref_eig())
  61.   #define Desk_screen_delta (*Desk_Screen__Ref_delta())
  62.   #define Desk_screen_bpp   (*Desk_Screen__Ref_bpp())
  63. #else
  64.   extern int        Desk_screen_mode;
  65.   extern Desk_wimp_point Desk_screen_size;
  66.   extern Desk_wimp_point Desk_screen_eig;        /* Log2( Desk_screen_delta)        */
  67.   extern Desk_wimp_point Desk_screen_delta;    /* pixel size in os coors    */
  68.   extern int        Desk_screen_bpp;        /* Bits per pixel        */
  69. #endif
  70.  
  71.  
  72.  
  73. extern Desk_bool Desk_Screen_CacheModeInfo(void);
  74.  /*
  75.   * This should be called before you try to use any of the above screen 
  76.   * variables. It only needs to be called whenever the screen mode changes
  77.   * so call it:
  78.   *   a) When you initialise your program, and whenever a mode change
  79.   *      message is received (see ModeChangeHandler, below)
  80.   *   b) Immediately before you use the variables (i.e. in your redraw
  81.   *      handler, etc.)
  82.   *
  83.   * It checks the screenmode, and if it has not changed, then the variables
  84.   * are not updated, so it is not too bad if you call it more often than
  85.   * you really need to (i.e. every time you redraw, for example).
  86.   */
  87.  
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.  
  93.  
  94. #endif
  95.